package com.zqxq.lottery.api.alipay.sign;

import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;

import java.util.Map;

/**
 * @author : 苦智
 * @Description ：
 * @Date : 2018-02-11 10:12
 **/
public class SignCheck {

    public static boolean signCheck(Map map){
        boolean signVerified=false;
        String CHARSET="UTF-8";
        String ALIPAY_PUBLIC_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtbtF107UafO5MeDWv90RQa9Y5kYYpUpoyj3EBgDTUbLn74zJqFuWFU97mo71PIRQUOwnfybgj5jWX3KcVXQNSxjUG/C6KruIIlpocWL/jjTWhMYgWzksw5OK2aqAGyXL9LDoKIueyQVfjeKspT9ADUDghWa7lgEdPVbtWl8xksXGOQ5UIgp/3ElDAtlCJ1HdHbUgjkLQdkUIX+3X8k2SRpCTRJVWXMa4O2ivJoSvXFMtkJ/16dlcdZiUgak/ZpF23Smx/xtYKdwBdXE12O/2ijNsPirbKAOUlbEQLSvz7rNOKCxroDS+mMh3V9Wk2zn4tWagdXTZbmIEQlR7MWrbXQIDAQAB";
        try {
            System.out.println(map);
            signVerified= AlipaySignature.rsaCheckV1(map, ALIPAY_PUBLIC_KEY, CHARSET);
            System.out.println("------");
            System.out.println(signVerified);
        } catch (AlipayApiException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return signVerified;
    }
}
